package com.team.controller;

import com.team.service.AdminService;
import com.team.service.SectionService;
import com.team.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WHZ
 * @date 2022年10月24日 14:07
 */
@RestController
@RequestMapping("/SectionAndAdmin")
public class SectionAndAdminController {
    @Autowired
    private SectionService sectionService;
    @Autowired
    private AdminService adminService;

    /**
     * 根据id查询管理员信息
     * @param id
     * @return
     */
    @RequestMapping("selectByid")
    public Result selectByid(int id){
        return adminService.selectByid(id);
    }

    @RequestMapping("/selectAlls")
    public Result selectAll(){
        return sectionService.selectAll();
    }
    /**
     * 根据id查询科室信息
     * @param id
     * @return
     */
    @RequestMapping("/selectAllByIds")
    public Result selectAllByIds(int id){
        return sectionService.selectAllByIds(id);
    }

    @RequestMapping("selectBySectionId")
    public Result selectBySectionId(int sid){
        return adminService.selectBySectionId(sid);
    }
}
